# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-columnize
pkgver=0.3.11
pkgrel=4
pkgdesc="Python module to align in columns a simple list"
url="https://github.com/rocky/pycolumnize"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-setuptools py3-nose py3-gpep517"
checkdepends="py3-pytest py3-mock py3-pytest-mock"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/c/columnize/columnize-$pkgver.tar.gz"
builddir="$srcdir"/columnize-$pkgver

replaces="py-columnize" # for backwards compatibility
provides="py-columnize=$pkgver-r$pkgrel" # for backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
aba1b911c57ac6f237460889d3da6dcfbedac3d42165dd99dc1798f3e2e767a3b895c4266fe82e5b35dfe43af7bff8e778f85bf9c71b10e8b13417e015779432  columnize-0.3.11.tar.gz
"
